<template>
  <view class="special-zones">
    <view class="zone-item" v-for="(zone, index) in zones" :key="index" @click="$emit('zone-click', {category: zone.title})">
      <text class="zone-title">{{zone.title}}</text>
      <text class="zone-subtitle">{{zone.subtitle}}</text>
      <image class="zone-image" :src="zone.image" mode="aspectFill"></image>
      <text class="zone-price">¥{{zone.price}}</text>
    </view>
  </view>
</template>

<script>
export default {
  name: 'SpecialZones',
  props: {
    zones: {
      type: Array,
      required: true
    }
  },
  emits: ['zone-click']
};
</script>

<style scoped lang="scss">
@import "../../../static/common.scss";

.special-zones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15rpx;
  padding: 0 30rpx;
  margin-bottom: 20rpx;
}

.zone-item {
  background-color: #fff;
  border-radius: 15rpx;
  padding: 20rpx 15rpx;
  text-align: center;
}

.zone-title {
  font-size: 24rpx;
  color: #333;
  font-weight: bold;
  display: block;
  margin-bottom: 5rpx;
}

.zone-subtitle {
  font-size: 20rpx;
  color: #666;
  display: block;
  margin-bottom: 15rpx;
}

.zone-image {
  width: 80rpx;
  height: 80rpx;
  border-radius: 10rpx;
  margin-bottom: 10rpx;
}

.zone-price {
  color: #ff4757;
  font-size: 24rpx;
  font-weight: bold;
}
</style>